<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /*
            异步
            1. 宏任务
               settimeout,setInterval
            2. 微任务
               then,catch,finally
            代码执行的优先级

            同步>微任务>宏任务
        */

      setTimeout(() => {
        console.log(2);
      });

      Promise.resolve().then(() => {
        console.log(3);
      });

      console.log(1);
    </script>
  </body>
</html>
